package javacafe.action.factory;

import javacafe.action.Action;
import javacafe.action.ActionFactory;
import javacafe.action.admin.BbsMgrAction;
import javacafe.action.admin.BeforeBbsMgrAction;
import javacafe.action.admin.CustMgrAction;
import javacafe.action.admin.CustSearchAction;
import javacafe.action.admin.MailingAction;
import javacafe.action.admin.MailingFormAction;
import javacafe.action.admin.UpdateMemberAction;
import javacafe.action.admin.PopupAction;
import javacafe.action.admin.PopupCreateAction;
import javacafe.action.admin.PopupUpdateAction;
import javacafe.action.admin.PopupDeleteAction;

public class AdminActionFactory implements ActionFactory {
	private static AdminActionFactory factory;
	
	public static AdminActionFactory getInstance(){
		if(factory==null){
			factory=new AdminActionFactory();
		}
		return factory;
	}

	public Action getAction(String command){
		Action action=null;
		if(command.equalsIgnoreCase("custmgr")){
			action=new CustMgrAction(); 
		}else if(command.equalsIgnoreCase("custsearch")){
			action=new CustSearchAction(); 
		}else if(command.equalsIgnoreCase("updatemember")){
			action=new UpdateMemberAction(); 
		}else if(command.equalsIgnoreCase("popup")){
			action=new PopupAction(); 
		}else if(command.equalsIgnoreCase("createpopup")){
			action=new PopupCreateAction(); 			
		}else if(command.equalsIgnoreCase("updatepopup")){
			action=new PopupUpdateAction(); 
		}else if(command.equalsIgnoreCase("deletepopup")){
			action=new PopupDeleteAction(); 
		}else if(command.equalsIgnoreCase("bbsmgrform")){
			action=new BeforeBbsMgrAction(); 
		}else if(command.equalsIgnoreCase("bbsmgr")){
			action=new BbsMgrAction(); 
		}else if(command.equalsIgnoreCase("mailingform")){
			action=new MailingFormAction(); 
		}else if(command.equalsIgnoreCase("mailing")){
			action=new MailingAction(); 
		}
		return action;
	}//
}
